package com.emagic.manage.biz;

import com.emagic.manage.data.entities.response.UserResponse;

/**
 * 用户
 *
 * @author baoy
 * @version 1.0
 *          Create by 16/4/26 下午7:25
 */
public class UserProfile {

    private String result;     //0:登陆成功 1: 帐号未激活  2:帐号已冻结 5:密码错误 6:帐号错误 7:域名错误 8:公司没有这个用户

    private String account;     //用户帐号
    private String userid;      //用户id
    private String companyid;   //公司id
    private String userroleid;  //用户角色 0：主讲 1：助教 2: 学员 3：直播用户 4:巡检员　10:系统管理员　11:平台管理员　12:企业管理员 14:二级代理
    private String pwd;
    private String sessionid;  //登出参数
    private String firstname;  //昵称

    public void apply(UserResponse userResponse) {
        this.account = userResponse.getAccount();
        this.userid = userResponse.getUserid();
        this.companyid = userResponse.getCompanyid();
        this.userroleid = userResponse.getUserroleid();
        this.pwd = userResponse.getPwd();
        this.sessionid = userResponse.getPwd();
        this.firstname = userResponse.getFirstname();
    }

    public UserResponse convert() {
        UserResponse userResponse = new UserResponse();
        userResponse.setAccount(account);
        userResponse.setUserid(userid);
        userResponse.setCompanyid(companyid);
        userResponse.setUserroleid(userroleid);
        userResponse.setPwd(pwd);
        userResponse.setSessionid(sessionid);
        userResponse.setFirstname(firstname);
        return userResponse;
    }

    public UserProfile() {
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    public String getCompanyid() {
        return companyid;
    }

    public void setCompanyid(String companyid) {
        this.companyid = companyid;
    }

    public String getUserroleid() {
        return userroleid;
    }

    public void setUserroleid(String userroleid) {
        this.userroleid = userroleid;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getSessionid() {
        return sessionid;
    }

    public void setSessionid(String sessionid) {
        this.sessionid = sessionid;
    }

    public String getFirstname() {
        return firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }
}
